package org.example.ai_chat.controller;
import org.example.ai_chat.pojo.user_status;
import org.example.ai_chat.service.impl.StatusServiceImpl;
import org.example.ai_chat.util.Result;
import org.example.ai_chat.util.ResultCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;




@RestController
@RequestMapping("/status")
public class UserStatusController {

    @Autowired
    private StatusServiceImpl statusService;
    @GetMapping("/{id}")
    public Result getUserStatus(@PathVariable int id) {
        user_status user_status = statusService.selectStatusByUserId(id);
        if(user_status==null) {
            return Result.build(null, ResultCodeEnum.ADMIN_ACCOUNT_NOT_EXIST_ERROR);
        }
        return Result.build(user_status, ResultCodeEnum.SUCCESS);
    }
}
